// 针对所有页面的通用的handle
var cf = require("../../config.js");
var util = require("../../utils/util.js");
var util2 = require("../../utils/util2.js");
var cusmallToken = wx.getStorageSync('cusmallToken');
var regeneratorRuntime = require("../../lib/js/runtime-module.js")
import Config from '../../utils/config2.js'
import Serv from './loginServ'

/*表单登陆块*/
function handleCommonFormSubmit(e) {
  var formId = e.detail.formId;
  cusmallToken = wx.getStorageSync('cusmallToken');
  wx.request({
    url: cf.config.pageDomain + '/applet/mobile/addFormId',
    data: {
      cusmallToken: cusmallToken,
      formId: formId
    },
    header: {
      'content-type': 'application/json'
    },
    success: function (res) {
      console.log("addFormId success：", formId);
    }
  })
}
/*导航tab切换块*/
function onNavTab(e) {
  var that = this;
  var webUrl = e.currentTarget.dataset.weburl;
  if (webUrl) {
    var app = that.data.app;
    app.globalData.webUrl = webUrl;
    wx.navigateTo({
      url: '/pages/web_view/web_view?webUrl=' + webUrl,
    })
  } else {
    return util.processNavClick(e, that);
  }
}
function getReviewConfig() {
  let cusmallToken = wx.getStorageSync('cusmallToken');
  let mallSiteId = wx.getStorageSync('mallSiteId');
  let ctx = this;
  return new Promise(function (resolve, reject) {

    wx.request({
      url: cf.config.pageDomain + "/applet/mobile/review/getReviewConfig",
      data: {
        mallSiteId: mallSiteId,
        cusmallToken: cusmallToken,
      },
      header: {
        'content-type': 'application/json'
      },
      success: function (res) {
        let data = res.data;
        console.log(data)
        if (data && 0 == data.ret) {
          ctx.setData({
            isOpenComment: data.model.reviewConfig.isOpen
          })
          resolve(data)
        } else {
          reject(data);
        }
      },
      fail() {

      },
      complete() {

      }
    })

  });
}
/*电话api*/
function commMakeCall(e) {
  let phonecode = e.currentTarget.dataset.tel;
  wx.makePhoneCall({
    phoneNumber: phonecode //仅为示例，并非真实的电话号码
  })
}
function onCancle(){
  wx.switchTab({
    url:'/pages/index/index'
  })
}
/*返回首页*/
function backToHome() {
  let app = this.data.app;
  let shopuid = app.globalData.shopuid;
  let fromuid = app.globalData.fromuid;
  //let url = "/pages/shopping_mall/index/index";
  let url=''
  wx.reLaunch({
    url: url
  })

}
/*地址开启*/
function fnOpenLocation(e) {
  console.log(e)
  let lat = parseFloat(e.currentTarget.dataset.lat || 22.5236670209857);
  let lng = parseFloat(e.currentTarget.dataset.lng || 113.94078612327576);
  wx.openLocation({
    latitude: lat,
    longitude: lng,
    scale: 28,
    name: e.currentTarget.dataset.address
  })
}
/**二维码埋点计算*/
function visitNum(params) {
  let data = Serv.visitNum(params)
}
function getPhoneNumber(e) {
  let that = this;
  let app = getApp();
  wx.removeStorageSync('jsCodeName');
  wx.login({
    success: function (res) {
      wx.setStorageSync('jsCodeName', res.code);
      if (e.detail.errMsg == 'getPhoneNumber:fail user deny') {
        wx.showModal({
          title: '提示',
          showCancel: false,
          content: '未授权',
          success: function () { }
        })
      } else {
        that.setData({
          encryptedData: e.detail.encryptedData,
          iv: e.detail.iv
        })
        if (app.globalData.isUserInfoAuth) {
          that.userInfoHandler()
        } else {
          that.setData({
            showModal: true,
            showAuthBox: false
          });
        }
      }
    }
  })

}
/*用户信息*/
function userInfoHandler(e) {
  let that = this;
  let app = getApp();
  let extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {};
  let uid = cf.config.customPack ? cf.config.uid : extConfig.uid;
  wx.getUserInfo({
    success: async function (res) {
      wx.setStorageSync('userInfo', res.userInfo);
      app.globalData.userinfoDetailData = res;
      that.setData({
        showAuthBox: false,
        showModal: false,
        userInfo: res.userInfo
      })
      let wxCode = wx.getStorageSync('jsCodeName');
      let type = wx.getStorageSync(Config.referrerType);
      let productId = wx.getStorageSync(Config.referrerProductId);
      let register_channel_code = wx.getStorageSync('register_channel_code');
      // 获取用户信息
      let userInfo = wx.getStorageSync('userInfo');
      wx.setStorageSync(Config.jsCodeKey, wxCode);
      // 调用后台接口获取cusmallToken
      let submitData = {
        code: wxCode,
        userInfo: userInfo,
        uid,
        type     
      }
      if(productId){
        submitData.productId = productId;
      }
      if(register_channel_code){
        submitData.register_channel_code = register_channel_code
        submitData.register_channel='西南小程序'
      }
      submitData.encryptedData = that.data.encryptedData;
      submitData.iv = that.data.iv;
      if (app.referrerInfo) {
        submitData.extraData = app.referrerInfo
      }
      let resp = await Serv.login({
        ...submitData,
         //推荐人id
        recommendId: wx.getStorageSync(Config.referrerIdKey)
      })
      let {
        data,
        success
      } = resp;
      if (success) {
        // 保存session_key,openid
        wx.setStorageSync(Config.openIdKey, data.openId)
        wx.setStorageSync(Config.sessionKey, data.sessionKey)
        wx.setStorageSync(Config.authName, data.zmzj_token)
        wx.setStorageSync(Config.userIdKey, data.userId)
        wx.setStorageSync(Config.phoneNoKey, data.mobile)
        wx.setStorageSync(Config.userInfoKey, res.userInfo)
        wx.setStorageSync('userType', data.userType)
        if (app.globalData.code.query.id) {
          that.visitNum({ id: app.globalData.code.query.id, userId: data.userId, userType: data.userType, type: 2 })
        }
        let from = that.data.from || "";
        /*if (from.indexOf('/index/index') !== -1) {
          wx.switchTab({
            url: '../index/index',
          })
        } else {
          wx.navigateBack({
            delta: 1
          })
        }*/

        let query = ''
        if (JSON.stringify(app.globalData.code.query) === "{}") {
          query = `scene=${app.globalData.code.scene}`
        } else {
          query = `scene=${app.globalData.code.scene}&param=${app.globalData.code.query.id}`
        }
        //小名片信息
        wx.setStorageSync('cusmallToken', data.token);
        wx.setStorageSync('lastTokenTime', new Date().getTime());
        wx.setStorageSync('eid', data.eid);
        let getEmployeeInfo = await app.getEmployeeInfo();
        that.userinfoFinishCb && that.userinfoFinishCb();
        //所属区域
        let codeParam={
          mobile:data.mobile,
          accountId:data.userId,
          type,
          recommendId:wx.getStorageSync(Config.referrerIdKey),
          userInfo:{...wx.getStorageSync(Config.userInfoKey),appId:1010,productId:productId}
        }
        if(register_channel_code){
          codeParam.register_channel_code = register_channel_code
          codeParam.register_channel='西南小程序'
        }
        Serv.zysqScanCode(codeParam);
       
        let result = await Serv.getSceneLog(query)
      } else {
        wx.login({
          success: res => {
            wx.setStorageSync('jsCodeName', res.code)
          }
        })
      }

    }
  });


}
/*关闭提示框*/
function CloseTips() {
  this.setData({
    "firstInTips": false
  })
}
/*检查用户信息*/
function checkUserInfo(cb) {
  let pageVm = this;
  let app = getApp();
  let extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {};
  let userInfo = wx.getStorageSync('userInfo');
  if (userInfo) {
    return true;
  } else {
    pageVm.userinfoFinishCb = function () {
      app.globalData.userInfo = wx.getStorageSync('userInfo');
    }
    wx.hideLoading();
    let appName = cf.config.customPack ? cf.config.name : extConfig.name;
    // let appLogo = cf.config.customPack ? cf.config.logo : extConfig.logo;
    let appLogo = cf.config.logo
    app.globalData.appName = appName;
    app.globalData.appLogo = appLogo;
    app.globalData.firstInTips = true;
    pageVm.setData({
      "showAuthBox": true,
      "firstInTips": true,
      appName: appName,
      appLogo: appLogo
    })
  }
  return false;
}
function showOptions(e) {
  let ctx = this;
  console.log(ctx);
  let idxm = e.currentTarget.dataset.idxm;
  console.log(idxm);
  let show = ctx.data.list[idxm].sOptions;
  ctx.setData({
    ['list[' + idxm + '].sOptions']: !show
  });
}
/*发送点赞*/
function sendLike(e) {
  let ctx = this;
  let id = e.currentTarget.dataset.id;
  let cusmallToken = wx.getStorageSync('cusmallToken');
  console.log("点击了 赞" + id)
  if (!id) {
    return;
  }
  let idxm = e.currentTarget.dataset.idxm;
  ctx.setData({
    idxm: idxm,
    ['list[' + idxm + '].sOptions']: false
  });
  wx.request({
    url: cf.config.pageDomain + '/applet/mobile/visitcard/friendscircle/thumbsUp',
    data: {
      cusmallToken: cusmallToken,
      friendsCircleId: id
    },
    header: {
      'content-type': 'application/json'
    },
    success: function (res) {
      var data = res.data;
      if (data && 0 === data.ret) {
        if (0 == ctx.data.list[ctx.data.idxm].type) {

          util.addBehaviorTrail(ctx.data.eId, 18);
        } else {
          util.addBehaviorTrail(ctx.data.eId, 20);
        }
        ctx.refreshZan(idxm);
      } else {
        wx.showToast({
          title: data.msg,
          icon: 'none',
          duration: 2000
        });
      }
    },
    fail() {

    }
  })
}
/*刷新赞*/
function refreshZan(iMoment) {
  var ctx = this;
  var thumbs = ctx.data.list[iMoment].thumbs, hasLike = false;

  for (let i in thumbs) {
    if (thumbs[i].fromNickname == ctx.data.userInfo.nickName) {
      hasLike = true;
      thumbs.splice(i, 1);
      break;
    }
  }
  if (!hasLike) {//曾经没有点过赞 则push
    thumbs.push({
      fromNickname: ctx.data.userInfo.nickName,
    })
  }
  ctx.setData({
    ['list[' + iMoment + '].thumbs']: thumbs
  })
}
/*评论回调*/
function toComment(e) {

  let ctx = this;
  let id = e.currentTarget.dataset.id;
  console.log("点击了评论按钮" + id);
  if (!id) {
    return;
  }
  let idxm = e.currentTarget.dataset.idxm;
  ctx.setData({
    open_input: true,
    fcId: id,
    idxm: idxm,
    ['list[' + idxm + '].sOptions']: false
  });
}
/*评论*/
function commitComment(e) {
  console.log(e);
  var ctx = this;
  ctx.handleCommonFormSubmit(e)
  var content = e.detail.value.commentCnt;
  if ("" === content) {
    wx.showToast({
      title: '评论内容不能为空',
      icon: 'none',
      duration: 2000
    })
    return;
  }
  let cusmallToken = wx.getStorageSync('cusmallToken');
  wx.request({
    url: cf.config.pageDomain + '/applet/mobile/visitcard/friendscircle/addComment',
    data: {
      cusmallToken: cusmallToken,
      friendsCircleId: ctx.data.fcId,
      content: content
    },
    header: {
      'content-type': 'application/json'
    },
    success: function (res) {
      var data = res.data;
      if (data && 0 === data.ret) {
        wx.showToast({
          title: '评论成功',
          icon: 'success',
          duration: 2000
        });
        if (0 == ctx.data.list[ctx.data.idxm].type) {

          util.addBehaviorTrail(ctx.data.eId, 14);
        } else {
          util.addBehaviorTrail(ctx.data.eId, 19);
        }
        ctx.setData({
          open_input: false
        });
        ctx.refreshComment(ctx.data.idxm, content);
      } else {
        wx.showToast({
          title: data.msg,
          icon: 'none',
          duration: 2000
        });
      }
    },
    fail() {

    }
  })
}
/*刷新评论*/
function refreshComment(iMoment, cnt) {
  var ctx = this;
  var comment = ctx.data.list[iMoment].comment;
  comment.push({
    fromNickname: ctx.data.userInfo.nickName,
    content: cnt,
    display: true

  })
  ctx.setData({
    ['list[' + iMoment + '].comment']: comment,
  })

}
/*不发送处理*/
function nosend(e) {
  console.log(e)
  let ctx = this;
  if (e.target.dataset.op) {
    return;
  }
  let list = ctx.data.list;
  for (let item of list) {
    item.sOptions = false;
  }
  ctx.setData({
    list: list,
    open_input: false,
    momentId: e.target.dataset.cpid || "",
    momentIdx: e.target.dataset.idxm,
    isperson: e.target.dataset.isperson || ""
  });
}
/*预览图片*/
function showImg(e) {
  var imgdx = e.target.dataset.imgdx;
  var ctx = this;
  var imgs = JSON.parse(JSON.stringify(ctx.data.list[e.target.dataset.idx].imgs));
  util.previewImageHkt(imgdx, imgs);
}
// 销售员聊天窗口
function gotoChatDetail(e) {
  var selToID = e.currentTarget.dataset.identify;
  wx.navigateTo({
    url: '/subPackages/pages/chat/chat?selToID=' + selToID,
  })
}
function queryCurCardDetail(eId, cusmallToken, cb) {// 通过eid 查询员工信息 查询当前卡片的信息
  var ctx = this;
  wx.request({
    url: cf.config.pageDomain + '/applet/mobile/visitcard/employee/getEmployeeInfo',
    data: {
      cusmallToken: cusmallToken,
      eid: eId
    },
    header: {
      'content-type': 'application/json'
    },
    success: function (res) {
      cb && cb(res)
    },
    complete: function () {
    }
  })
}
function gochatDetail(e) {
  let {eid,openid} =e.currentTarget.dataset
  let eId1 =eid
  var eId2 = wx.getStorageSync('eId');
  let eId = eId1 ? eId1 : eId2;
  let app = getApp();

  this.setData({
    isNewsTip: false,
    card_detail_noread: 0
  })
  app.subscribeMessage(()=>{
    wx.navigateTo({
      url: "/subPackages/pages/chat_detail/chat_detail?eId=" + eId
    });
   
  },cf.config.messageTemplateId);
  wx.setStorageSync("has_readmsg_" + eId, true);
}
function gochatDetailAndGetPhoneNumber(e) {
  let that = this;
  let cusmallToken = wx.getStorageSync('cusmallToken');
  let eId = wx.getStorageSync('eId');
  let _app = getApp();
  if (e.detail.iv) {
    wx.request({
      url: cf.config.pageDomain + '/applet/mobile/visitcard/member/updateTel',
      data: {
        cusmallToken: cusmallToken,
        eid: eId,
        encryptedData: e.detail.encryptedData,
        iv: e.detail.iv
      },
      header: {
        'content-type': 'application/json'
      },
      success: function (res) {
        _app.globalData.hasGetCustomMobile = true;
        that.setData({
          app: _app
        })
        wx.navigateTo({
          url: "/subPackages/pages/chat_detail/chat_detail?eId=" + eId
        });
        wx.setStorageSync("has_readmsg_" + eId, true);
        util.addBehaviorTrail(eId, 16);
      },
      complete: function () {
      }
    })

  } else {
    wx.navigateTo({
      url: "/subPackages/pages/chat_detail/chat_detail?eId=" + eId
    });
    wx.setStorageSync("has_readmsg_" + eId, true);
    util.addBehaviorTrail(eId, 16);
  }
}
//判断是否是销售员
function cacheUserIsSales() {
  let ctx = this;
  let employee = wx.getStorageSync("employee");
  if (employee) {
    if (employee && employee.wxBind && (employee.powerSwitch & (Math.pow(2, 0))) != 0) {
      ctx.setData({
        isSales: true
      });

    }
  } else {
    ctx.userIsSales();
  }
}
function userIsSales(cb) {
  var ctx = this;
  let cusmallToken = wx.getStorageSync('cusmallToken');
  wx.request({
    url: cf.config.pageDomain + "/applet/mobile/visitcard/employee/getEmployeeInfo",
    data: {
      cusmallToken: cusmallToken,
    },
    header: {
      'content-type': 'application/json'
    },
    success: function (res) {
      var data = res.data;
      var employee = data.model && data.model.employee;
      if (data && 0 === data.ret && employee && employee.wxBind && (employee.powerSwitch & (Math.pow(2, 0))) != 0) {
        ctx.setData({
          isSales: true
        });

      }
      cb && cb();
    },
    fail() {

    },
    complete() {
    }
  });
}
/**
 * 跟进时间 转换
 * followTime 时间戳
 */
function followTimeToTxt(followTime) {
  var dist = Date.now() - followTime;
  var day1 = 86400000;
  if (1 > dist / day1) {//hours
    var followTimeF = util.formatDate(new Date(followTime));
    var todayTimeF = util.formatDate(new Date());

    if (followTimeF == todayTimeF) {
      return "今天已跟进";
    } else {
      return "1天前跟进";
    }

  } else if (1 <= dist / day1 && 31 > dist / day1) {
    return parseInt(dist / day1) + "天前跟进";
  } else if (31 <= dist / day1 && 365 > dist / day1) {
    return parseInt(dist / day1 / 30) + "月前跟进";
  } else {
    return "一年前跟进"
  }
}

function getAdInfo(advertConfig, adType) {
  let adInfo = {};
  adInfo.type = adType;//动态页底部广告
  adInfo.show = false;
  for (let i = 0, len = advertConfig.length; i < len; i++) {
    if (adInfo.type == advertConfig[i].type && advertConfig[i].content) {
      adInfo.dataType = advertConfig[i].dataType;
      adInfo.content = advertConfig[i].content;
      adInfo.show = true;
      break;
    }
  }
  //直客的广告是否显示
  adInfo.show = wx.getStorageSync('adShow');
  this.setData({ adInfo });
}

function findGroup() {
  var ctx = this;
  wx.request({
    url: cf.config.pageDomain + "/applet/mobile/visitcard/quickReply/findGroup",
    data: {
      cusmallToken: wx.getStorageSync('cusmallToken'),
      start: 0,
      limit: 50
    },
    header: {
      'content-type': 'application/json'
    },
    success: function (res) {
      var data = res.data;
      if (data && 0 === data.ret) {
        ctx.setData({
          wordArtGroupList: data.model.list
        });
      }
    },
    fail() {

    },
    complete() {
      wx.hideLoading();
    }
  });
}

//分页查询企业话术
function fetchWordArtByGroup() {
  //
  var ctx = this;
  if (ctx.data.isLoading || ctx.data.isBottom) {
    return;
  }
  ctx.setData({
    isLoading: true
  });
  wx.showLoading({
    title: '加载中',
  });
  wx.request({
    url: cf.config.pageDomain + "/applet/mobile/visitcard/quickReply/findPage",
    data: {
      cusmallToken: wx.getStorageSync('cusmallToken'),
      gid: ctx.data.wordArtGroupList[ctx.data.wordArtGroupIdx].id,
      start: (ctx.data.curPage - 1) * ctx.data.pageSize,
      limit: ctx.data.pageSize
    },
    header: {
      'content-type': 'application/json'
    },
    success: function (res) {
      var data = res.data;
      if (data && 0 === data.ret) {
        var list = data.model.list;
        for (let item of list) {
          if (40 < item.content.length) {
            item.contentSimple = item.content.substring(0, 40) + "...";
          } else {
            item.contentSimple = item.content;
          }
        }
        ctx.setData({
          wordArtList: ctx.data.wordArtList.concat(list),
          total: data.model.total
        });
        if (data.model.total == ctx.data.wordArtList.length) {
          ctx.setData({
            isBottom: true
          });
        }
      }
    },
    fail() {

    },
    complete() {
      ctx.setData({
        isLoading: false
      });
      wx.hideLoading();
    }
  });
}
//跳转楼盘
 function toBuildingDetail(e){
 let productId =  e.currentTarget.dataset.productid
  wx.navigateTo({
    url:`/subPackages/pages/buildingDetail/buildingDetail?productId=${productId}`
  })
 }
 //跳转户型
 function toUnitDetails(e){
  let productId =  e.currentTarget.dataset.productid
  wx.navigateTo({
    url:`/subPackages/pages/unitDetails/unitDetails?productId=${productId}&type=1`
  });
  }
 //导入腾讯用户
 function accountImport(param,cb){
   
  wx.request({
    url: cf.config.pageDomain + 'applet/mobile/visitcard/sign/accountImport',
    data: param,
    header: {
      'content-type': 'application/json'
    },
    success: function (res) {
      if(cb)cb(res)
    }
  });
 }
//查询销售员最近使用的话术 或者 自定义的话术
function fetchRecentOrCustWordArt(isCust) {
  var ctx = this;
  var reqUrl = "/applet/mobile/visitcard/quickReply/findRecentPage";
  if (isCust) {
    reqUrl = "/applet/mobile/visitcard/quickReply/findDefinedPage";
  }
  if (ctx.data.isLoading || ctx.data.isBottom) {
    return;
  }
  ctx.setData({
    isLoading: true
  });

  wx.request({
    url: cf.config.pageDomain + reqUrl,
    data: {
      cusmallToken: wx.getStorageSync('cusmallToken'),
      eid: wx.getStorageSync('employee').id,
      start: (ctx.data.curPage - 1) * ctx.data.pageSize,
      limit: ctx.data.pageSize,
    },
    header: {
      'content-type': 'application/json'
    },
    success: function (res) {
      var data = res.data;
      if (data && 0 === data.ret) {
        var list = data.model.list;
        for (let item of list) {
          if (40 < item.content.length) {
            item.contentSimple = item.content.substring(0, 40) + "...";
          } else {
            item.contentSimple = item.content;
          }
        }
        ctx.setData({
          wordArtList: ctx.data.wordArtList.concat(list),
          total: data.model.total
        });
        if (data.model.total == ctx.data.wordArtList.length) {
          ctx.setData({
            isBottom: true
          });
        }
      }
    },
    fail() {

    },
    complete() {
      ctx.setData({
        isLoading: false
      });
      wx.hideLoading();
    }
  });
}
function radarCall(e) {
  console.log(e);
  var tel = e.currentTarget.dataset.tel;
  wx.makePhoneCall({
    phoneNumber: tel,
    success() {
    }
  });
}

function addPvMall(goodsId) {
  var ctx = this;
  wx.request({
    url: cf.config.pageDomain + "/applet/mobile/visitcard/goodsNew/addPv",
    data: {
      cusmallToken: cusmallToken,
      goodsId: goodsId
    },
    header: {
      'content-type': 'application/json'
    },
    success: function (res) {
      var data = res.data;
      console.log(data)
    },
    fail() {

    },
    complete() {
    }
  });
}
function addPvPro(goodsId) {
  var ctx = this;
  wx.request({
    url: cf.config.pageDomain + "/applet/mobile/goods/addPv",
    data: {
      cusmallToken: cusmallToken,
      goodsId: goodsId
    },
    header: {
      'content-type': 'application/json'
    },
    success: function (res) {
      var data = res.data;
      console.log(data)
    },
    fail() {

    },
    complete() {
    }
  });
}

function getStortDataList(identify,chat_content,name,type){
  var msgKey = wx.getStorageSync(name)||{};
  var msgList = [];
  var data =[]
  var chatList = chat_content
  var msyList = msgKey[identify]&&msgKey[identify]||[]
  if(msyList.length!=chat_content.length&&!type){ //只改变数组属性的值
    msyList.push(chatList[chatList.length-1]);
  }else{
    msyList = chat_content;
  }
   if(msyList.length<15){
    msgKey[identify]=msyList
   }else{
     data =[...msyList].reverse();
    for(var k=0;k< 15;k++){
      msgList.push(data[k])
    }
    msgKey[identify]=msgList.reverse();
   }

  wx.setStorageSync(name,msgKey)

}


module.exports = {
  handleCommonFormSubmit: handleCommonFormSubmit,
  onNavTab: onNavTab,
  getReviewConfig,
  backToHome,
  userInfoHandler,
  commMakeCall,
  checkUserInfo,
  fnOpenLocation,
  showOptions,
  sendLike,
  refreshZan,
  toComment,
  commitComment,
  refreshComment,
  gochatDetailAndGetPhoneNumber,
  nosend,
  showImg,
  gochatDetail,
  gotoChatDetail,
  queryCurCardDetail,
  cacheUserIsSales,
  userIsSales,
  followTimeToTxt,
  getAdInfo,
  findGroup,
  fetchWordArtByGroup,
  fetchRecentOrCustWordArt,
  radarCall,
  addPvMall,
  addPvPro,
  getPhoneNumber,
  visitNum,
  getStortDataList,
  toBuildingDetail,
  accountImport,
  toUnitDetails,
  onCancle
}